package com.bst.bsj.bops.web.biz.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bst.bsj.bops.web.biz.MerchantRoleService;
import com.bst.bsj.common.dal.daointerface.MerchantRoleDAO;
import com.bst.bsj.common.dal.dataobject.Merchant;
import com.bst.bsj.common.dal.dataobject.MerchantRole;

@Service("merchantRoleService")
public class MerchantRoleServiceImpl implements MerchantRoleService {
  @Autowired
  private MerchantRoleDAO merchantRoleDao;

  private static final Log logger = LogFactory.getLog(MerchantRoleServiceImpl.class);

  @Override
  public int delete(Long merchantId) {
    int lid = 0;
    try {
      lid = merchantRoleDao.delete(merchantId);

    } catch (Exception e) {
      logger.error("merchantRoleServiceImpl.delete(id) error!", e);
    }
    return lid;
  }

  @Override
  public Long save(MerchantRole merchantRole) {
    Long lid = 0l;
    try {
      lid = merchantRoleDao.save(merchantRole);
    } catch (Exception e) {
      logger.error("MerchantRoleServiceImpl.save(banner) error!", e);
    }
    return lid;
  }

  @Override
  public MerchantRole getByUserId(Long merchantId) {
    return merchantRoleDao.getUserId(merchantId);
  }

  @Override
  public void update(Long merchantId, Long roleId) {
  
    merchantRoleDao.update(merchantId,roleId);
  }

  
}
